It's an Apache's ANT task using java_lzma
412b (SourceForge.net)
This task allows to perform 7-zip encoding/decoding with ANT (see Tutorial
: Writing Task)
Here is an sample from a build.xml using this task:
<target name="7z" depends="init"> <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip"/> <sevenzip input="c:/temp/SOURCE.xyz" output="c:/temp/DESTINATION.lzma" task="encode" dictionnary="16"/> </target>
|
|
Here are the parameters for this task :
Attribute |
Description |
Required |
Range / Values |
task |
Type of operation |
Yes |
encode | decode |
input |
inputFile |
Yes |
|
output |
outputFile |
Yes |
|
mode |
set compression mode |
No |
[0, 2], default: 2 (max) |
dictionnary |
set dictionary |
No |
[0, 28], default: 23 (8 Mb) |
fastbytes |
set number of fast bytes |
No |
[5, 255], default: 128 |
literalcontextbits |
set number of literal context bits |
No |
[0, 8], default: 3 |
literalposbits |
set number of literal pos bits |
No |
[0, 4], default: 0 |
posbits |
set number of literal pos bits |
No |
[0, 4], default: 2 |
matchfinder |
set Match Finder |
No |
[bt2, bt4, bt4b], default: bt4 |
endofstreammarker |
write End Of Stream marker |
No |
|
|
Downloads :
- Full package : binaries + sources + example (for Windows) : 7z.7z
or 7z.zip
- Sources : (java_lzma_412b + task) : 7z-src.jar
- Binaries : (java_lzma_412b + task) : 7z.jar
Example for Windows :
@echo off
cd c:\workspace
%JAVA%
-cp C:/javalib/ant-launcher.jar;C:/javalib/ant.jar;C:/javalib/7z.jar;
org.apache.tools.ant.launch.Launcher
pause
|
Buildfile:
build.xml
init:
[echo] hello
7z:
[sevenzip] LZMA# 4.12 beta Copyright (c) 1999-2004 Igor Pavlov
2004-12-10
[sevenzip] JAVA LZMA Encoder 4.12 myspace
[sevenzip] [e, -d16, c:/temp/FIREBIRD.FBK, c:/temp/FIREBIRD.FBK.lzma]
[sevenzip] time : 47344 ms
Appuyez sur une touche pour continuer...
|
|
File FIREBIRD.FBK : 6369 Kb
Result :
- FIREBIRD.FBK.lzma : dictionnary=16 : 1013 Kb - dictionnary=20 : 919
Kb - dictionnary=24 : out of memory (*)
- FIREBIRD.FBK.bz2 : 1100 Kb
- FIREBIRD.FBK.gzip : 1421 Kb
- FIREBIRD.FBK.zip : 1421 Kb
(*) Try with :
%JAVA% -Xmx268435456
-cp C:/javalib/ant-launcher.jar;C:/javalib/ant.jar;C:/javalib/7z.jar;
org.apache.tools.ant.launch.Launcher
Result : dictionnary = 24 : 903 Kb
contact : pharmasoft-7z-ant [AT] pharmasoft.be
|